package com.itheima.health.controller;

import com.itheima.health.common.R;
import com.itheima.health.model.vos.TongjiTaocaiVo;

import com.itheima.health.model.vos.TongjiyemianVo;
import com.itheima.health.model.vos.tongjiVo;
import com.itheima.health.service.TongjiService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/report")
public class TongjiController {
    @Autowired
    private TongjiService tongjiService;

    @GetMapping("/getMemberReport")

    public R<tongjiVo> getMemberReport() {
       tongjiVo vo = tongjiService.getMemberReport();
       return R.success(vo);

    }
    @GetMapping("/getSetmealReport")
    public R getSetmealReport(){
        TongjiTaocaiVo vo = tongjiService.getSetmealReport();
        return R.success(vo);
    }

    @GetMapping("/getBusinessReportData")
    public R getBusinessReportData(){
        TongjiyemianVo vo = tongjiService.Business();
        return R.success(vo);
    }
    @GetMapping("/exportBusinessReport")
    public R exportBusinessReport(HttpServletResponse response)  throws Exception {
        tongjiService.exportBusinessReport(response);
        return R.success();
    }
}





